<template>
	<div id="home">
		<h1>总览</h1>
		<div v-text="newData"></div>
		<div >{{count}}-a</div>
		<button type="default" @click="$store.commit('add')">+</button>
		<button type="default" @click="$store.commit('reducers')">-</button>|
		<button type="default" @click="inewData">+</button>
		<button type="default" @click="addActions">+</button>
	</div>
</template>

<script>
	import {mapState,mapMutations,mapActions} from 'vuex'
	export default {
		data() {
			return {}
		},
		computed: {
			...mapState(['count']),
			counts: state => state.count,
			newData () {
			   return this.$store.state.count;
			}
		},
		methods: {
			...mapMutations(['add']),
			...mapActions(['addActions']),
			inewData(){
				this.$store.commit('add')
			}
		}
	}
</script>

<style scoped>
	#home {
		background-color: #FAECD8;
	}
</style>
